package webbrow.aop.model;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;

public class StatisticServiceImpl implements StatisticService{
	private StatisticDao statisticDao;
	
	public StatisticServiceImpl(StatisticDao statisticDao){
		this.statisticDao= statisticDao;
	}

	@Override
	public void confirmQueryRank(String id) throws SQLException {
		int result = statisticDao.selectMemeberById(id);
		if(result==0){
			statisticDao.insertMemberRank(id);
		}else{
			statisticDao.updateMemberRank(id);
		}
	}

	@Override
	public List<MemberRankVO> selectRankList() throws SQLException {
		return statisticDao.selectMemberRank();
	}

}
